$TFAM = $ARGV[0];
chomp($TFAM);
$QC = $ARGV[1];
chomp($QC);
if( !(-e $TFAM && -e $QC))
{
	die "one of the input file doesn't exists\n";
}
open(TFAM,$TFAM);
open(QC,$QC);
$n =0;
while(<TFAM>)
{
	chomp($_);
	@a = split(" ",$_);
	$hash{$a[1]} = $n++;
	#print "$.\n";				
}
@b = ();
while(<QC>)
{
	chomp($_);
	@a = split("\t",$_);
	if(exists($hash{$a[0]}))
	{
		$b[$hash{$a[0]}] = $_;	
	}	
}
$file = "$QC"."_removed";
open(WRB,">$file") or die " not able to write $file\n";
for($i=0;$i<@b;$i++)
{
	print WRB $b[$i]."\n"; 
}
system("mv $file $QC");
